/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package upeu.edu.pe.modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author YAKELYN
 */
@Entity
@Table(name = "SAU_FORMATO_ESTANDAR")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SauFormatoEstandar.findAll", query = "SELECT s FROM SauFormatoEstandar s"),
    @NamedQuery(name = "SauFormatoEstandar.findByIdFormatoEstandar", query = "SELECT s FROM SauFormatoEstandar s WHERE s.idFormatoEstandar = :idFormatoEstandar"),
    @NamedQuery(name = "SauFormatoEstandar.findByEstado", query = "SELECT s FROM SauFormatoEstandar s WHERE s.estado = :estado"),
    @NamedQuery(name = "SauFormatoEstandar.findByDescripcion", query = "SELECT s FROM SauFormatoEstandar s WHERE s.descripcion = :descripcion"),
    @NamedQuery(name = "SauFormatoEstandar.findByNombre", query = "SELECT s FROM SauFormatoEstandar s WHERE s.nombre = :nombre")})
public class SauFormatoEstandar implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_FORMATO_ESTANDAR")
    private BigDecimal idFormatoEstandar;
    @Basic(optional = false)
    @Column(name = "ESTADO")
    private BigInteger estado;
    @Basic(optional = false)
    @Column(name = "DESCRIPCION")
    private String descripcion;
    @Basic(optional = false)
    @Column(name = "NOMBRE")
    private String nombre;
    @JoinColumn(name = "ID_ESTANDAR", referencedColumnName = "ID_ESTANDAR")
    @ManyToOne(optional = false)
    private SauEstandar idEstandar;

    public SauFormatoEstandar() {
    }

    public SauFormatoEstandar(BigDecimal idFormatoEstandar) {
        this.idFormatoEstandar = idFormatoEstandar;
    }

    public SauFormatoEstandar(BigDecimal idFormatoEstandar, BigInteger estado, String descripcion, String nombre) {
        this.idFormatoEstandar = idFormatoEstandar;
        this.estado = estado;
        this.descripcion = descripcion;
        this.nombre = nombre;
    }

    public BigDecimal getIdFormatoEstandar() {
        return idFormatoEstandar;
    }

    public void setIdFormatoEstandar(BigDecimal idFormatoEstandar) {
        this.idFormatoEstandar = idFormatoEstandar;
    }

    public BigInteger getEstado() {
        return estado;
    }

    public void setEstado(BigInteger estado) {
        this.estado = estado;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public SauEstandar getIdEstandar() {
        return idEstandar;
    }

    public void setIdEstandar(SauEstandar idEstandar) {
        this.idEstandar = idEstandar;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFormatoEstandar != null ? idFormatoEstandar.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SauFormatoEstandar)) {
            return false;
        }
        SauFormatoEstandar other = (SauFormatoEstandar) object;
        if ((this.idFormatoEstandar == null && other.idFormatoEstandar != null) || (this.idFormatoEstandar != null && !this.idFormatoEstandar.equals(other.idFormatoEstandar))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upeu.edu.pe.modelo.SauFormatoEstandar[ idFormatoEstandar=" + idFormatoEstandar + " ]";
    }
    
}
